package demo07.test1;

import org.junit.Test;

import java.lang.reflect.Method;

public class MyAnnotation {

    @Test
    @StandardDoc(data = "2025/4/29",author = "chen")
    public void test(){
        System.out.println("test.");
    }

    @Test
    public void processAnnotation() throws Exception {

        Class clazz = MyAnnotation.class;
        Method testMethod = clazz.getDeclaredMethod("test");
        if (testMethod.isAnnotationPresent(StandardDoc.class)){
            StandardDoc annotation = testMethod.getDeclaredAnnotation(StandardDoc.class);
            System.out.println(annotation.author());
            System.out.println(annotation.data());
            System.out.println(annotation.version());
        }
    }
}
